package mybitset;

public class BitSetSort {


    public static void main(String[] args) {
        // 位图 排序
        int[] array = {1,3,2,13,10,3,14,18,3};
        MyBitSet myBitSet = new MyBitSet(18);
        for (int i = 0; i < array.length; i++) {
                myBitSet.set(array[i]);
        }

        for (int i = 0;i < myBitSet.elem.length; i++){
            for (int j = 0; j < 8; j++) {
                if ((myBitSet.elem[i] & (1 << j)) != 0) {
                    System.out.println(i*8+j);
                }
            }
        }
    }
}
